package com.example.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class IndexController {
    @RequestMapping(value = "/say",method = {RequestMethod.GET})
    public @ResponseBody String Index(){
        return "hello,spring boot!";
    }

    @RequestMapping(value = "/mapValue",method = {RequestMethod.GET})
    public @ResponseBody Map<String,Object> mapValue(){
        Map<String,Object> retMap=new HashMap<String,Object>();
        retMap.put("message","执行成功");
        retMap.put("state",200);
        retMap.put("data","这是data结果");
        return retMap;
    }
}
